package com.manager.protocol.controller;

import com.manager.common.customer.utils.RemoteApi;
import com.manager.common.ssh.RemoteExecuteLinuxCommandTools;
import com.manager.common.utils.DataTools;
import com.manager.common.vo.ResultVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/tcpMonitor")
public class TcpMonitorController {

    @RequestMapping("/getLinuxTcpInfo")
    public ResultVO getLinuxTcpInfo(){
        try {
            String url = DataTools.getSystemSettingStringValByKey("get_linux_tcp_info_url");
            JSONObject jsonObject = new JSONObject();
            ResultVO<JSONArray> resultVO = RemoteApi.executeHttp(url,jsonObject);
            return resultVO;
        }catch (Exception e){
            e.printStackTrace();
        }
        return ResultVO.failed();
    }
}
